home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / docdemos / bitsizeofdemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-09  |  527 b   |  18 lines

  1. program BitSizeOfDemo;
  2. var
  3.   a: Integer;
  4.   b: array [1 .. 8] of Char;
  5.   c: Integer (12);
  6.   d: packed record
  7.        x: Integer (12);
  8.        y: 0 .. 3
  9.      end;
  10. begin
  11.   WriteLn (BitSizeOf (a));    { Size of an `Integer'; usually 32 bits. }
  12.   WriteLn (BitSizeOf (b));    { Size of eight `Char's; usually 64 bits. }
  13.   WriteLn (BitSizeOf (c));    { e.g. 16 bits (smallest addressable space). }
  14.   WriteLn (BitSizeOf (d));    { e.g. 16 }
  15.   WriteLn (BitSizeOf (d.x));  { 12 }
  16.   WriteLn (BitSizeOf (d.y))   {  2 }
  17. end.
  18.